BinderExample
by Mai Nguyen, NeXT Developer Support Team

Overview

In order to run this example, you need to have a SYBASE server with a pubs database installed.  The pubs database is a sample database provided with the SYBASE limited server package. 

This example shows how to use a DBBinder object to perform a simple query such as  finding a paritcular author name and all the data related to that author (ie address, state, zip code, phone number). The key for the query can be the person's last name or the state of his residence.
 
Note that  the use of binders is generally not necessary if you use the higher level DBKit objects (such as TableView or DBModule), or if you use the DBRecordList object.
However, binders can sometimes be handy if you need to connect objects and variables in your NeXTStep program to the external database directly.

Please read the documentation on binders for more information.

Program Organization

Major Classes in the Application

BinderHandler	A general handler object.  A subclass of the Object class.  Performs miscellaneous initialzations, and simple binder operations such as assigning a prototype to a binder, and retrieving data from the external database through that binder.

Topics Of Interest

The purpose of this example is to show you some simple examples of the usage of the DBBinder object in the Access Layer:

- How to initialize a binder object with an Objective-C  prototype object:
See the method initBinder: in the file BinderHandler.m

- How to build queries using the DBQualifier object and select records based on qualifiers:
See the method findByName: or findByState:  in the file BinderHanlder.m

Known Problems
1)  The program doesn't work  if you don't get connected to the SYBASE server.